const addTwoNumbers = (l1, l2) => {
    let arr = []
    let sum1 = 0;
    let sum2 = 0;
    for (let i = 0; i < l1.length; i++) {
        sum1 += l1[i] * Math.pow(10, i)
    }
    for (let i = 0; i < l2.length; i++) {
        sum2 += l2[i] * Math.pow(10, i)
    }
    let sum = sum1 + sum2;
    let sumStr = String(sum);
    for (let j = 0; j < sumStr.length; j++) {
        arr.unshift(Number(sumStr[j]))
    }
    return arr
}
console.log(addTwoNumbers([9, 9, 9, 9, 9, 9, 9], [9, 9, 9, 9]));
